<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings">
<xsl:output method="xml" indent="yes" />
<xsl:variable name="mymenu">
<div class="menu">
<h3>Setup</h3>
<p>
<a href="installation.html">Installation</a><br/>
<a href="configuration.html">Configuration</a>
</p>
<h4>Customisation</h4>
<p><a href="custom_classes.html">Custom Classes</a>
</p>
<h3>Interfaces</h3>
<p>
<a href="api.html">Quick API Guide</a><br/>

<a href="opensearch.html">Opensearch Guide</a><br/>

<a href="opensearch_client.html">Opensearch Client</a>
</p>
</div>
</xsl:variable>

<xsl:variable name="myfooter">
<div id="footer">

<p><a href="introduction.html">Introduction / Index</a> | <a href="http://duetopia.googlecode.com/">Code Repository</a>
</p>
<p> <a href="http://www.terradue.com/duetopia/"><img src="img/terradue_logo.jpg" border="0"/></a>
</p>
</div>
</xsl:variable>


<xsl:template match="/">
<html>
<head>
<xsl:copy-of select="html/head/title"/>
<link rel="stylesheet" href="docs.css"/>
</head>
<body>

<xsl:for-each select="/html/body/div">

<xsl:variable name="cl">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="contains('menu',$cl)">
<xsl:copy-of select="$mymenu"/>
</xsl:when>
<xsl:otherwise>
        <xsl:choose>
        <xsl:when test="contains('footer',$cl)">
        </xsl:when>
        <xsl:otherwise>
        <xsl:copy-of select="."/>
        </xsl:otherwise>
        </xsl:choose>   
</xsl:otherwise>
</xsl:choose>

</xsl:for-each>


<xsl:for-each select="/html/body/div/div">
<xsl:if test="contains('footer',@id)">
<xsl:copy-of select="$myfooter"/>
foo
</xsl:if>
</xsl:for-each>

     
</body>                                                                         </html>

</xsl:template>

</xsl:stylesheet>

